package com.nus.fellowmark.dao;

import com.nus.fellowmark.entity.SysUserRoleMappingEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * User-Role Relationship Table
 * 
 * @author Chen Ruoyi
 * @email chenruoyisz@gmail.com
 * @date 2023-02-11  
 */
@Mapper
public interface SysUserRoleMappingDao extends BaseMapper<SysUserRoleMappingEntity> {
    /**
     * select user role by user id
     * @param userId
     * @return
     */
    @Select("SELECT * FROM sys_user_role_mapping WHERE userId=#{userId} and deleted=0 LIMIT 1")
    SysUserRoleMappingEntity selectByUserId(Integer userId);
}
